unit gui_form_tiatai_Resources;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  SystemManager, basicio_player;

type

  { TTTiatai_ResourcesForm }

  TTTiatai_ResourcesForm = class(TForm)
    blue_streets: TLabel;
    blue_spacer1: TLabel;
    red_streets: TLabel;
    red_spacer1: TLabel;
    whiteBox: TGroupBox;
    white_streets: TLabel;
    white_Inventions_: TLabel;
    blue_Inventions_: TLabel;
    red_Inventions_: TLabel;
    white_monopolies: TLabel;
    blue_monopolies: TLabel;
    red_monopolies: TLabel;
    yellow_monopolies: TLabel;
    yellow_Inventions_: TLabel;
    yellow_streets: TLabel;
    white_spacer1: TLabel;
    YellowBox: TGroupBox;
    BlueBox: TGroupBox;
    RedBox: TGroupBox;
    yellow_cities: TLabel;
    blue_cities: TLabel;
    red_cities: TLabel;
    white_citiesextended: TLabel;
    yellow_citiesextended: TLabel;
    blue_citiesextended: TLabel;
    red_citiesextended: TLabel;
    yellow_dirt: TLabel;
    blue_dirt: TLabel;
    red_dirt: TLabel;
    yellow_FreeStreets: TLabel;
    blue_FreeStreets: TLabel;
    red_FreeStreets: TLabel;
    yellow_inventions: TLabel;
    blue_inventions: TLabel;
    red_inventions: TLabel;
    yellow_knights: TLabel;
    blue_knights: TLabel;
    red_knights: TLabel;
    yellow_ore: TLabel;
    blue_ore: TLabel;
    red_ore: TLabel;
    yellow_sheeps: TLabel;
    blue_sheeps: TLabel;
    red_sheeps: TLabel;
    yellow_spacer: TLabel;
    blue_spacer: TLabel;
    red_spacer: TLabel;
    yellow_spacer1: TLabel;
    yellow_wheat: TLabel;
    blue_wheat: TLabel;
    red_wheat: TLabel;
    yellow_winpoints: TLabel;
    blue_winpoints: TLabel;
    red_winpoints: TLabel;
    white_wood: TLabel;
    white_sheeps: TLabel;
    white_spacer: TLabel;
    white_inventions: TLabel;
    white_dirt: TLabel;
    white_knights: TLabel;
    white_cities: TLabel;
    white_ore: TLabel;
    white_FreeStreets: TLabel;
    white_wheat: TLabel;
    white_winpoints: TLabel;
    yellow_wood: TLabel;
    blue_wood: TLabel;
    red_wood: TLabel;
  private
    { private declarations }
  public
    procedure UpdateInfos;
    { public declarations }
  end;

implementation

{$R *.lfm}

{ TTTiatai_ResourcesForm }

procedure TTTiatai_ResourcesForm.UpdateInfos;
  procedure SetCaption(AElement: TLabel; AName: String; AValue: Integer);
  begin
    AElement.Caption := AName+': '+inttostr(AValue);
  end;
begin
  if not visible then exit;
  //white
  SetCaption(white_wood,  'wood',  GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Resources.Wood);
  SetCaption(white_dirt,  'dirt',  GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Resources.Dirt);
  SetCaption(white_sheeps,'sheeps',GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Resources.sheeps);
  SetCaption(white_wheat, 'wheat', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Resources.wheat);
  SetCaption(white_ore,   'ore',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Resources.ore);

  SetCaption(white_knights,     'knights',      GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).PlayerResources.Knights);
  SetCaption(white_winpoints,   'winpoints',    GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).PlayerResources.Winpoints);
  SetCaption(white_FreeStreets, 'free streets', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).PlayerResources.Streets);
  SetCaption(white_Inventions_, 'inventions',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).PlayerResources.Inventions );
  SetCaption(white_monopolies,  'monopolies',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).PlayerResources.Monopolies );

  SetCaption(white_cities,         'cities',          GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Buyable.Cities);
  SetCaption(white_citiesextended, 'extended cities', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Buyable.Cities_extended);
  SetCaption(white_inventions,     'inventions',      GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Buyable.Inventions);
  SetCaption(white_streets,        'streets',         GlobalSystemManager.IO.Data.GetPlayerByColor(PC_white).Buyable.Streets);

  //yellow
  SetCaption(yellow_wood,  'wood',  GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Resources.Wood);
  SetCaption(yellow_dirt,  'dirt',  GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Resources.Dirt);
  SetCaption(yellow_sheeps,'sheeps',GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Resources.sheeps);
  SetCaption(yellow_wheat, 'wheat', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Resources.wheat);
  SetCaption(yellow_ore,   'ore',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Resources.ore);

  SetCaption(yellow_knights,     'knights',      GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).PlayerResources.Knights);
  SetCaption(yellow_winpoints,   'winpoints',    GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).PlayerResources.Winpoints);
  SetCaption(yellow_FreeStreets, 'free streets', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).PlayerResources.Streets);
  SetCaption(yellow_Inventions_, 'inventions',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).PlayerResources.Inventions );
  SetCaption(yellow_monopolies,  'monopolies',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).PlayerResources.Monopolies );

  SetCaption(yellow_cities,         'cities',          GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Buyable.Cities);
  SetCaption(yellow_citiesextended, 'extended cities', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Buyable.Cities_extended);
  SetCaption(yellow_inventions,     'inventions',      GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Buyable.Inventions);
  SetCaption(yellow_streets,        'streets',         GlobalSystemManager.IO.Data.GetPlayerByColor(PC_yellow).Buyable.Streets);

  //blue
  SetCaption(blue_wood,  'wood',  GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Resources.Wood);
  SetCaption(blue_dirt,  'dirt',  GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Resources.Dirt);
  SetCaption(blue_sheeps,'sheeps',GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Resources.sheeps);
  SetCaption(blue_wheat, 'wheat', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Resources.wheat);
  SetCaption(blue_ore,   'ore',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Resources.ore);

  SetCaption(blue_knights,     'knights',      GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).PlayerResources.Knights);
  SetCaption(blue_winpoints,   'winpoints',    GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).PlayerResources.Winpoints);
  SetCaption(blue_FreeStreets, 'free streets', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).PlayerResources.Streets);
  SetCaption(blue_Inventions_, 'inventions',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).PlayerResources.Inventions );
  SetCaption(blue_monopolies,  'monopolies',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).PlayerResources.Monopolies );

  SetCaption(blue_cities,         'cities',          GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Buyable.Cities);
  SetCaption(blue_citiesextended, 'extended cities', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Buyable.Cities_extended);
  SetCaption(blue_inventions,     'inventions',      GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Buyable.Inventions);
  SetCaption(blue_streets,        'streets',         GlobalSystemManager.IO.Data.GetPlayerByColor(PC_blue).Buyable.Streets);

  //red
  SetCaption(red_wood,  'wood',  GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Resources.Wood);
  SetCaption(red_dirt,  'dirt',  GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Resources.Dirt);
  SetCaption(red_sheeps,'sheeps',GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Resources.sheeps);
  SetCaption(red_wheat, 'wheat', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Resources.wheat);
  SetCaption(red_ore,   'ore',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Resources.ore);

  SetCaption(red_knights,     'knights',      GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).PlayerResources.Knights);
  SetCaption(red_winpoints,   'winpoints',    GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).PlayerResources.Winpoints);
  SetCaption(red_FreeStreets, 'free streets', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).PlayerResources.Streets);
  SetCaption(red_Inventions_, 'inventions',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).PlayerResources.Inventions );
  SetCaption(red_monopolies,  'monopolies',   GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).PlayerResources.Monopolies );

  SetCaption(red_cities,         'cities',          GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Buyable.Cities);
  SetCaption(red_citiesextended, 'extended cities', GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Buyable.Cities_extended);
  SetCaption(red_inventions,     'inventions',      GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Buyable.Inventions);
  SetCaption(red_streets,        'streets',         GlobalSystemManager.IO.Data.GetPlayerByColor(PC_red).Buyable.Streets);
end;

end.
